package keter.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import keter.framework.model.Codelist;
import keter.framework.web.util.MediaType;
import keter.web.controller.base.KeterBaseController;

@Controller
@RestController
public class CodelistController extends KeterBaseController{
	
	@GetMapping(value = "/public/keter/codelist/{codeKind}", produces = MediaType.APPLICATION_JSON_UTF_8)//, 
	@ResponseBody
	public String getCodelistByKind(@PathVariable String codeKind) throws Exception {
        return  toJson(Codelist.dao.findByKind(codeKind));
	}
}
